package com.eorchis.module.classuser.domain;


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.trainingclass.domain.TrainingClass;
import com.eorchis.module.user.domain.User;

/**
 * Title: ClassUser<br>
 * Description: 培训班用户关系实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author HuangTF
 * @createDate 2013-12-10
 * @version $Revision$
 */
@Entity
@Table(name = "TRAINING_CLASS_USER")
public class ClassUser extends AbstractBaseEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 同步网上专题班人员地址
	 * */
	public static final String WSZTB_WSDL_USER_URL=new String("http://ntschool.bjce.gov.cn/ntschool/webservice/thematicClassStudentWebService?wsdl");

	/**
	 * 锁定
	 */
	public static final Integer IS_LOCK_STATE = new Integer(1);
	
	/**
	 * 报名通过
	 */
	public static final Integer IS_AUDITING_Y=new Integer(1);
	/**
	 * 报名未通过
	 */
	public static final Integer IS_AUDITING_N=new Integer(2);
	/**
	 * 报名待审核
	 */
	public static final Integer NO_AUDITING=new Integer(3);
	/**
	 * 撤销待审核
	 */
	public static final Integer NO_AUDITING_CX=new Integer(4);
	/**
	 * 报名通过(撤销驳回)
	 */
	public static final Integer IS_AUDITING_Y_CX_N=new Integer(5);
	/**
	 * 匿名用户(学员评估用)
	 */
	public static final Integer IS_AUDITING_N_M=new Integer(6);
	/**
	 * 报名方式：个人选学
	 */
	public static final Integer PERSONAL=new Integer(1);
	/**
	 * 报名方式：单位指定
	 */
	public static final Integer UNIT=new Integer(2);
	/**
	 * 报名来源：报名审核
	 */
	public static final Integer SOURCE_AUDIT_ONE=new Integer(1);
	/**
	 * 报名方式：培训班报名
	 */
	public static final Integer SOURCE_AUDIT_TWO=new Integer(2);
	/**
	* 报名方式：培训班报名
	*/
	public static final Integer SOURCE_AUDIT_THREE=new Integer(3);
	/**
	 * 活动
	 */
	public static final Integer IS_ACTIVE_STATE_Y=new Integer(1);
	/**
	 * 作废
	 */
	public static final Integer IS_ACTIVE_STATE_N=new Integer(2);
	/**
	 * 全勤
	 */
	public static final Integer IS_ATTENDANCE_Y=new Integer(1);
	/**
	 * 缺勤
	 */
	public static final Integer IS_ATTENDANCE_N=new Integer(2);
	
	private String classUserId;//培训班用户关系ID
	private TrainingClass trainingClass;//培训班ID
	private User user;//用户ID
	private Double trainingHours;//学时
	private Integer auditingState;//审核人员状态 1:审核通过 2:审核未通过3:未审核
	private Date auditingUserDate;//审核人员时间
	private String signUpYear;
	private Integer attendanceState;//考勤状态 1 全勤2 缺勤
	private Integer signUpType;//报名方式  1：个人选学  2： 单位指定
	//部委选学报名新增字段
	private String userName;//学员姓名
	private BaseData sexCode;//性别
	private Date birthday;//出生日期
	private BaseData folkCode;//民族
	private String mobileTelephone;//手机号码
	private String dutyRemark;//单位及职务
	private String remark;//备注
	private BaseData dutyLevelCode;//职级
	
	private String rejectReason;//撤销报名驳回原因
	
	//add RongSL
	private String appraise ;//学员评价
	private Integer appraiseStatus;//评价状态
	private Date auditingDate;//审核时间
	private String auditingUserId;//审核人ID
	private String auditingUserIP;//审核人IP
	private String examinationRemark;//考核备注
	private Date latestOperateDate;//最后操作时间
	private Date lastOperateTime;//最后操作时间

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="CLASS_USER_ID")
	/**
	 * 设置培训班用户关系ID
	 */		
	public String getClassUserId() {
		return classUserId;
	}
	/**
	 * 获取培训班用户关系ID
	 */		
	public void setClassUserId(String classUserId) {
		this.classUserId = classUserId;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="CLASS_ID")
	/**
	 * 设置培训班
	 */		
	public TrainingClass getTrainingClass() {
		return trainingClass;
	}
	/**
	 * 获取培训班
	 */		
	public void setTrainingClass(TrainingClass trainingClass) {
		this.trainingClass = trainingClass;
	}
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="USER_ID")
	/**
	 * 设置用户
	 */		
	public User getUser() {
		return user;
	}
	/**
	 * 获取用户
	 */		
	public void setUser(User user) {
		this.user = user;
	}
	@Transient
	/**
	 * 设置学时
	 */		
	@Column(name="training_Hours")
	public Double getTrainingHours() {
		return trainingHours;
	}
	/**
	 * 获取学时
	 */		
	public void setTrainingHours(Double trainingHours) {
		this.trainingHours = trainingHours;
	}
	
	@Column(name="AUDITING_STATE")
	/**
	 * 设置审核状态
	 */		
	public Integer getAuditingState() {
		return auditingState;
	}
	/**
	 * 获取审核状态
	 */		
	public void setAuditingState(Integer auditingState) {
		this.auditingState = auditingState;
	}
	
	
	/**
	 * 获取审核人员时间
	 */
	@Column(name="AUDITING_USER_DATE")
	public Date getAuditingUserDate() {
		return auditingUserDate;
	}
	/**
	 * 设置审核人员时间
	 */
	public void setAuditingUserDate(Date auditingUserDate) {
		this.auditingUserDate = auditingUserDate;
	}
	
	@Column(name="SIGNUP_YEAR")
	public String getSignUpYear() {
		return signUpYear;
	}
	public void setSignUpYear(String signUpYear) {
		this.signUpYear = signUpYear;
	}
	
	/**
	 * 获取考勤状态 1 全勤2 缺勤
	 */	
	@Column(name="ATTENDANCE_STATE")
	public Integer getAttendanceState() {
		return attendanceState;
	}
	/**
	 * 设置考勤状态 1 全勤2 缺勤
	 */		
	public void setAttendanceState(Integer attendanceState) {
		this.attendanceState = attendanceState;
	}
	/**
	 * 获取报名方式
	 */	
	@Column(name="Sign_Up_Type")
	public Integer getSignUpType() {
		return signUpType;
	}
	/**
	 * 设置报名方式
	 */
	public void setSignUpType(Integer signUpType) {
		this.signUpType = signUpType;
	}
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "培训班用户关系ID======>" + getClassUserId()+"\n培训班ID======>" + getTrainingClass()+"\n用户======>" + getUser()+"\n学时======>" + getTrainingHours()+"\n是否结业======>" +"\n审核状态======>" + getAuditingState();
	}
	/**
	 * 获取学员名称
	 */
	@Column(name="User_Name")
	public String getUserName() {
		return userName;
	}
	/**
	 * 设置学员名称
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	/**
	 * 获取性别
	 */
	@ManyToOne(cascade={javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.REFRESH}, fetch=FetchType.LAZY, optional=true)
	@JoinColumn(name="SEX_CODE", referencedColumnName="DATA_CODE")
	public BaseData getSexCode() {
		return sexCode;
	}
	public void setSexCode(BaseData sexCode) {
		this.sexCode = sexCode;
	}
	/**
	 * 获取出生日期
	 */
	@Column(name="Birthday")
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	/**
	 * 获取民族
	 */
	@ManyToOne(cascade={javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.REFRESH}, fetch=FetchType.LAZY, optional=true)
	@JoinColumn(name="FOLK_CODE", referencedColumnName="DATA_CODE")
	public BaseData getFolkCode() {
		return folkCode;
	}
	public void setFolkCode(BaseData folkCode) {
		this.folkCode = folkCode;
	}
	/**
	 * 获取手机号码
	 */
	@Column(name="Mobile_Telephone")
	public String getMobileTelephone() {
		return mobileTelephone;
	}
	public void setMobileTelephone(String mobileTelephone) {
		this.mobileTelephone = mobileTelephone;
	}
	/**
	 * 获取单位及职务
	 */
	@Column(name="DUTY_REMARK")
	public String getDutyRemark() {
		return dutyRemark;
	}
	public void setDutyRemark(String dutyRemark) {
		this.dutyRemark = dutyRemark;
	}
	/**
	 * 获取备注
	 */
	@Column(name="REMARK")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	/**
	 * 撤销报名驳回原因
	 */
	@Column(name="REJECT_REASON")
	public String getRejectReason() {
		return rejectReason;
	}
	public void setRejectReason(String rejectReason) {
		this.rejectReason = rejectReason;
	}
	
	/**
	 * 学员评价
	 * */
	@Column(name="APPRAISE")
	public String getAppraise() {
		return appraise;
	}
	public void setAppraise(String appraise) {
		this.appraise = appraise;
	}
	
	/**
	 * 学员评价状态
	 * */
	@Column(name="APPRAISE_STATUS")
	public Integer getAppraiseStatus() {
		return appraiseStatus;
	}
	public void setAppraiseStatus(Integer appraiseStatus) {
		this.appraiseStatus = appraiseStatus;
	}

	/**
	 * 获取职级
	 */
	@ManyToOne(cascade={javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.REFRESH}, fetch=FetchType.LAZY, optional=true)
	@JoinColumn(name="duty_Level_Code", referencedColumnName="DATA_CODE")
	public BaseData getDutyLevelCode() {
		return dutyLevelCode;
	}
	public void setDutyLevelCode(BaseData dutyLevelCode) {
		this.dutyLevelCode = dutyLevelCode;
	}
	
	@Column(name="auditing_Date")
	public Date getAuditingDate() {
		return auditingDate;
	}
	public void setAuditingDate(Date auditingDate) {
		this.auditingDate = auditingDate;
	}
	@Column(name="auditing_user_id")
	public String getAuditingUserId() {
		return auditingUserId;
	}
	public void setAuditingUserId(String auditingUserId) {
		this.auditingUserId = auditingUserId;
	}
	@Column(name="auditing_User_IP")
	public String getAuditingUserIP() {
		return auditingUserIP;
	}
	public void setAuditingUserIP(String auditingUserIP) {
		this.auditingUserIP = auditingUserIP;
	}
	@Column(name="examination_Remark")
	public String getExaminationRemark() {
		return examinationRemark;
	}
	public void setExaminationRemark(String examinationRemark) {
		this.examinationRemark = examinationRemark;
	}
	
	@Column(name="LATEST_OPERATE_DATE")
	public Date getLatestOperateDate() {
		if (this.latestOperateDate == null) {
			this.latestOperateDate = new Date();
		}
		return latestOperateDate;
	}
	public void setLatestOperateDate(Date latestOperateDate) {
		this.latestOperateDate = latestOperateDate;
	}
	@Column(name="LAST_OPERATE_TIME")
	public Date getLastOperateTime() {
		return lastOperateTime;
	}
	public void setLastOperateTime(Date lastOperateTime) {
		this.lastOperateTime = lastOperateTime;
	}
	
	
	
	
	
	
}
